import request from '../request'

export const getToken = () =>
  request.post('/auth/local', {
    identifier: 'renchao',
    password: 'renchao1234'
  })

export const getFileTables = () => request.get('/file-tables')

export const postFileTable = (formData, fileList) =>
  request.post(`/file-tables`, formData, {
    onUploadProgress: (progressEvent) => {
      console.log(fileList)
      const process = Math.round((progressEvent.loaded * 100) / progressEvent.total)

      fileList.status = '上传中'
      fileList.process = process
    }
  })
